using IQIGame.Onigao.Framework;
using IQIGame.Onigao.Game;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay
{
    public class UIN_CommonDarkLightPreview : UIBaseNode
    {

        #region Template Generate,don't modify
        protected partial class UIB_UIN_CommonDarkLightPreview
        {
            #region ObjectBinding Generate 
            public GameObject dark { protected set; get; }
            public GameObject light { protected set; get; }
            public GameObject preview { protected set; get; }
            public virtual void InitBinding(ObjectBinding __binding)
            {
                __binding.TryGetVariableValue<UnityEngine.GameObject>("dark", out var __tbv0);
                this.dark = __tbv0;
                __binding.TryGetVariableValue<UnityEngine.GameObject>("light", out var __tbv1);
                this.light = __tbv1;
                __binding.TryGetVariableValue<UnityEngine.GameObject>("preview", out var __tbv2);
                this.preview = __tbv2;
            }

            #endregion ObjectBinding Generate 
        }
        #endregion Template Generate,don't modify

        #region fields & properties
        protected UIB_UIN_CommonDarkLightPreview ui { get; set; }
        #endregion

        protected override void BeforeInit()
        {
            ui = new UIB_UIN_CommonDarkLightPreview();
            ui.InitBinding(this.csObjBind);
        }

        protected override void OnInit()
        {

        }

        protected override void OnShow()
        {

        }

        protected override void OnHide()
        {

        }

        public void Show(int state)
        {
            this.Show();
            bool isDark = state == 0;
            bool isLight = state == 1;
            bool isPreview = state == 2;
            this.ui.dark.SetActive(isDark);
            this.ui.light.SetActive(isLight);
            this.ui.preview.SetActive(isPreview);
        }

        protected override void OnDispose()
        {

        }
    }
}
